/*
 * SettingsWidget.h
 *
 *  Created on: Jan 5, 2011
 *      Author: kmueller
 */

#ifndef SETTINGSWIDGET_H_
#define SETTINGSWIDGET_H_

#include <QWidget>
#include <QDialog>
#include <QLabel>
#include <QComboBox>

class QScrollArea;
class QAbstractSlider;
class QCheckBox;
class QCloseEvent;
class QTabWidget;
class AbstractSetting;
class MainWindow;

class SliderLabel: public QLabel {
Q_OBJECT

public:
	SliderLabel(AbstractSetting *setting, QWidget *parent = 0);

public slots:
void setIntText(int);

private:
	AbstractSetting *setting;

};

class SettingsComboBox: public QComboBox {
Q_OBJECT

public:
	SettingsComboBox(AbstractSetting *s, QWidget *parent = 0);
	void retranslateUi();

private:
	AbstractSetting* setting;

};

class SettingsWidget: public QDialog {
Q_OBJECT

public:
	SettingsWidget(MainWindow *parent);
	void closeEvent(QCloseEvent *event);

private slots:
void retranslateUi();

private:
	SettingsComboBox* createCombo(AbstractSetting *s);
	QAbstractSlider* createScrollBar(AbstractSetting *s);
	QCheckBox* createCheckbox(AbstractSetting *s);

	void createGeneral();
	void createGPS();
	void createRouting();
	void createGUI();

	QTabWidget *tabs;

	QScrollArea *general;
	QScrollArea *gps;
	QScrollArea *routing;
	QScrollArea *gui;

	QPushButton *bClose;

	SettingsComboBox *language;
	SettingsComboBox *orientation;
	SettingsComboBox *unblank;
	SettingsComboBox *unit;
	SettingsComboBox *degree;

	QLabel *lLanguage;
	QLabel *lOrientation;
	QLabel *lUnblank;
	QLabel *lUnit;
	QLabel *lDegreeFormat;

	SettingsComboBox *autocenter;
	SettingsComboBox *speedlimit;

	QLabel *lGPSPolling;
	QLabel *lReducedGPSPolling;
	QLabel *lAutoCenter;
	QLabel *lSpeedLimit;

	SettingsComboBox *announcement;
	SettingsComboBox *routecalc;
	QCheckBox *avoidHighway;
	QCheckBox *avoidTollroad;

	QLabel *lAnnouncements;
	QLabel *lRouteCalculation;

	QLabel *lShadowMap;

	QCheckBox *rotate;
	QCheckBox *scale;
	QCheckBox *compass;
	QCheckBox *poi;
	QCheckBox *velocity;

	SettingsComboBox *colors;
	SettingsComboBox *arrival;
	SettingsComboBox *volumeKeys;

	QLabel *lColors;
	QLabel *lArrival;
	QLabel *lVolumeKeys;
};

#endif /* SETTINGSWIDGET_H_ */
